export const dynamic = "force-dynamic"; /** * /activate/[orderId] * * Post-purchase eSIM activation page. * * Phone number / WhatsApp is collected HERE — optionally — after the user * has already paid and created their account. It is never required at sign-up. * * The orderId is the Stripe Checkout session_id (or templateId in dev/mock mode). */ import { auth } from "@clerk/nextjs/server"; import { redirect } from "next/navigation"; import { userOwnsOrder } from "@/lib/checkout-order-claim"; import { ActivateClient } from "./ActivateClient"; export const metadata = { title: "Activate eSIM" }; interface Props { params: Promise<{ orderId: string }>; } export default async function ActivatePage({ params }: Props) { const { userId } = await auth(); if (!userId) redirect("/sign-in"); const { orderId } = await params; const ownsOrder = await userOwnsOrder(userId, orderId); if (!ownsOrder) redirect("/shop"); return ; }